package hard

import "sort"

func FindMedianSortedArrays(nums1 []int, nums2 []int) float64 {
	allList := append(nums1, nums2...)
	sort.Ints(allList)
	length := len(allList)
	if length%2 == 0 {
		mid := length / 2
		return float64(allList[mid-1]+allList[mid]) / 2.0
	} else {
		mid := length / 2
		return float64(allList[mid])
	}
}
